import { Component, OnInit } from '@angular/core';
import { AuthService } from 'src/app/service/auth.service';
import { JsonResult } from 'src/app/model';

@Component({
  selector: 'app-login',
  templateUrl: './login.component.html',
  styleUrls: ['./login.component.css']
})
export class LoginComponent implements OnInit {

  constructor(
    private authService:AuthService
  ) { }

  ngOnInit() {
  }

  login(){
    this.authService.login().subscribe(
      ( jr:JsonResult ) =>{
        alert('登录成功！');
      },error => alert('登录失败！')
    )
  }

  
}
